﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="get_Reading.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Lesson.get_Reading" %>

<%@ Import Namespace="DataAccess" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    <%
        var id = int.Parse(Request.QueryString["id"]);
        var get_read = new TblLessonReadingController().FetchAll().Where(x => x.LessonId == id).ToList();
        
        if(get_read.Count!=0){ %>
    <div class="w3-row w3-border w3-margin-bottom">
        <div class="w3-hide read_id"><%=get_read[0].ReadId %></div>
        <header class="read-name w3-row w3-padding w3-orange w3-text-white w3-large">
            <i class="muiten fa fa-chevron-down w3-right"></i>
            <span>文型（ぶんけい）</span>
        </header>
        <div class="lesson-child-content w3-padding">
            <div class="w3-row">
                <textarea id="bung-ke"><%=get_read[0].ReadContent %></textarea>
            </div>
            <div class="w3-row w3-padding-top w3-center">
                <a class="btn_save_reading1 w3-btn w3-orange w3-text-white"><i class="fa fa-save"></i>&nbsp;Lưu chỉnh sửa</a>
            </div>
        </div>
    </div>
    <div class="w3-row w3-border w3-margin-bottom">
        <div class="w3-hide read_id"><%=get_read[1].ReadId %></div>
        <header class="read-name w3-row w3-padding w3-orange w3-text-white w3-large">
            <i class="muiten fa fa-chevron-down w3-right"></i>
            <span>例文（れいぶん）</span>
        </header>
        <div class="lesson-child-content w3-padding">
            <div class="w3-row">
                <textarea id="re-bung"><%=get_read[1].ReadContent %></textarea>
            </div>
            <div class="w3-row w3-padding-top w3-center">
                <a class="btn_save_reading2 w3-btn w3-orange w3-text-white"><i class="fa fa-save"></i>&nbsp;Lưu chỉnh sửa</a>
            </div>
        </div>
    </div>
    <%}else{ %>
    <div class="w3-row w3-border w3-margin-bottom">
        <div class="w3-hide read_id"></div>
        <header class="read-name w3-row w3-padding w3-orange w3-text-white w3-large">
            <i class="muiten fa fa-chevron-down w3-right"></i>
            <span>Bưng kê</span>
        </header>
        <div class="lesson-child-content w3-padding">
            <div class="w3-row">
                <textarea id="bung-ke"></textarea>
            </div>
            <div class="w3-row w3-padding-top w3-center">
                <a class="btn_save_reading w3-btn w3-orange w3-text-white"><i class="fa fa-save"></i>&nbsp;Lưu chỉnh sửa</a>
            </div>
        </div>
    </div>
    <div class="w3-row w3-border w3-margin-bottom">
        <div class="w3-hide read_id"></div>
        <header class="read-name w3-row w3-padding w3-orange w3-text-white w3-large">
            <i class="muiten fa fa-chevron-down w3-right"></i>
            <span>Rê bưng</span>
        </header>
        <div class="lesson-child-content w3-padding">
            <div class="w3-row">
                <textarea id="re-bung"></textarea>
            </div>
            <div class="w3-row w3-padding-top w3-center">
                <a class="btn_save_reading w3-btn w3-orange w3-text-white"><i class="fa fa-save"></i>&nbsp;Lưu chỉnh sửa</a>
            </div>
        </div>
    </div>
    <%} %>
</body>
</html>
